Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Little refactoring of OrdVector #320

Merged
merged 20 commits into from
Sep 13, 2023
Merged

Little refactoring of OrdVector #320

merged 20 commits into from
Sep 13, 2023

Conversation

kilohsakul
Copy link
Collaborator

@kilohsakul kilohsakul commented Sep 3, 2023

Few little things in OrdVector:

  • some renaming
  • somewhat in-place insert of another OrdVector (aka in-place union)
  • use std::lower_bound instead of custom binary search for insert of a single element
  • std::set_union instead of custom merge

Small debordelization of utils.hh

Does anyone know how the push_back/emplace_back in OrdVector should be done?

@codecov
Copy link

codecov bot commented Sep 3, 2023

Codecov Report

Patch coverage: 84.09% and project coverage change: -0.02% ⚠️

Comparison is base (7f27641) 72.76% compared to head (d1f1bb9) 72.74%.
Report is 1 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #320      +/-   ##
==========================================
- Coverage   72.76%   72.74%   -0.02%     
==========================================
  Files          33       33              
  Lines        4167     4146      -21     
  Branches      958      953       -5     
==========================================
- Hits         3032     3016      -16     
  Misses        755      755              
+ Partials      380      375       -5     
Files Changed Coverage Δ
include/mata/utils/closed-set.hh 63.88% <66.66%> (+0.68%) ⬆️
include/mata/utils/ord-vector.hh 67.74% <82.35%> (-1.54%) ⬇️
include/mata/utils/utils.hh 82.81% <83.33%> (ø)
include/mata/nfa/delta.hh 86.30% <100.00%> (+0.19%) ⬆️
src/nfa/delta.cc 89.25% <100.00%> (ø)
src/nfa/operations.cc 64.89% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kilohsakul kilohsakul marked this pull request as draft September 3, 2023 15:05
@kilohsakul kilohsakul marked this pull request as ready for review September 3, 2023 16:52
Copy link
Member

@tfiedor tfiedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found no Colonel nor Major issues. Consider removing the commented code, it will haunt us in future.

include/mata/utils/ord-vector.hh Show resolved Hide resolved
include/mata/utils/ord-vector.hh Show resolved Hide resolved
include/mata/utils/utils.hh Show resolved Hide resolved
bindings/python/CONTRIBUTING.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@Adda0 Adda0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should measure the introduced optimizations quickly (just a simple script, for loop calling these functions with each version). For further comments, see the opened discussions.

include/mata/nfa/delta.hh Outdated Show resolved Hide resolved
include/mata/nfa/delta.hh Show resolved Hide resolved
include/mata/utils/ord-vector.hh Outdated Show resolved Hide resolved
include/mata/utils/ord-vector.hh Show resolved Hide resolved
include/mata/utils/ord-vector.hh Outdated Show resolved Hide resolved
include/mata/utils/ord-vector.hh Outdated Show resolved Hide resolved
include/mata/utils/ord-vector.hh Show resolved Hide resolved
include/mata/utils/ord-vector.hh Outdated Show resolved Hide resolved
include/mata/utils/ord-vector.hh Outdated Show resolved Hide resolved
include/mata/utils/closed-set.hh Outdated Show resolved Hide resolved
include/mata/utils/utils.hh Show resolved Hide resolved
@Adda0 Adda0 force-pushed the in_place_uni_for_OrdVector branch from 10b9f95 to 317690d Compare September 13, 2023 11:23
Copy link
Collaborator

@Adda0 Adda0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Adda0 Adda0 merged commit 6bfac4a into devel Sep 13, 2023
@Adda0 Adda0 deleted the in_place_uni_for_OrdVector branch September 13, 2023 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants